import request from '@/utils/request'

/**
 * 获取科室列表
 */
export function getDepartmentList (data) {
    return request({
        url: '/MRMS/api/OrgDepartment/Query',
        method: 'post',
        data
    })
}

/**
 * 获取标准科室列表
 */
export function getStandardDep (data) {
    return request({
        url: '/MRMS/Api/Department/All',
        method: 'post',
        data
    })
}

/**
 * 添加科室
 */
export function addDepartment (data) {
    return request({
        url: '/MRMS/Api/OrgDepartment/Add',
        method: 'post',
        data
    })
}

/**
 * 编辑科室
 */
export function editDepartment (data) {
    return request({
        url: '/MRMS/api/OrgDepartment/Edit',
        method: 'post',
        data
    })
}

/**
 * 修改科室状态
 */
export function changeState (data) {
    return request({
        url: `/MRMS/api/OrgDepartment/ChangeState?id=${data.id}&isEnable=${data.isEnable}`,
        method: 'get',
        data
    })
}

/**
 * 上传文件
 */
export function uploadDepartmentFile (data) {
    return request({
        url: `/MRMS/api/OrgDepartment/Import`,
        method: 'post',
        data,
        headers: {'Content-Type': 'multipart/form-data'}
    })
}
